# Contributor: Tuan Anh Tran <me@tuananh.org>
# Maintainer: Tuan Anh Tran <me@tuananh.org>
pkgname=nom
pkgver=2.1.4
pkgrel=0
pkgdesc="RSS reader for the terminal"
url="https://github.com/guyfedwards/nom"
arch="all"
depends="glow"
license="GPL-3.0-or-later"
makedepends="go"
# bumping go-sqlite in go.{mod,sum} to solve issue with musl. ref: https://github.com/mattn/go-sqlite3/issues/1164
source="$pkgname-$pkgver.tar.gz::https://github.com/guyfedwards/nom/archive/refs/tags/v$pkgver.tar.gz
	update-go-sqlite3.patch
	"
builddir="$srcdir/nom-$pkgver/"

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	msg "Building nom"
	go build -o nom cmd/nom/main.go
}

check() {
	go test -v ./internal/...
}

package() {
	install -Dm0755 nom -t "$pkgdir"/usr/bin/
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 -t "$pkgdir"/usr/share/doc/"$pkgname" README.md
}

sha512sums="
3dde1e13cac6e7d5731c85c40e5ed992a5fbe1705f1910e2cfc0f396d90382f272a4359d30a97e2d92e1efcd4ea0361226ca25698a03df3095fa6b432f62e1ef  nom-2.1.4.tar.gz
422329cfba5655f62061bbff64a8227d891b0fa6d3a49a9d307bbe033b47889a871a97cea2c45ca069869a3604f073f72734337a9d583d7ece9d01e9b6585216 update-go-sqlite3.patch
"
